package com.yp.infrastructure.mvc.service.impl;

import com.yp.infrastructure.mvc.exception.MvcException;
import com.yp.infrastructure.mvc.session.UserSession;

import javax.annotation.Resource;

public abstract class AbstractService {

    @Resource
    protected UserSession session;

    protected <T> T getUserCredential() throws MvcException {
        Object obj = session.get();
        if (null == obj) return null;
        return (T) session.get();
    }

}
